<template>
  <!-- <div>列表设计器</div> -->
  <div class="body">
    <tool :fullName="fullName" @save="save"></tool>
    <!-- <columnDesign ref="columnDesign" :columnData="columnData" :appColumnData="appColumnData"
          :modelType="dataForm.type" :webType="dataForm.webType" /> -->
    <columnDesign ref="columnDesign" :columnData="columnData" :appColumnData="appColumnData"
           />
  </div>
  
</template>

<script>
import ColumnDesign from '../ColumnDesign'
import tool from '../tool/index.vue'
import devFormService from "@/service/dev/DevFormService";
import mixin from '@/mixins/form'
export default {
  mixins: [mixin],
  components:{
    ColumnDesign,
    tool
  },
  data(){
    return{
      fullName:'列表设计'
    }
  },
  methods:{
    save(){
      this.$refs['columnDesign'].getData().then(res => {
        let columnData = res.columnData
        console.log(columnData);
        columnData = JSON.stringify(columnData)
        let param = {
          id:this.$route.query.id,
          columnData:columnData
        }
        console.log(param);
        devFormService.save(param).then((res)=>{
          if(res.status == 200){
            this.$message({
              message: '保存成功',
              type: 'success'
            });
          }
        })
      })
    },
    close(){
      this.$refs['columnDesign'].close()
    }
  }
}
</script>

<style>
  .body{
    padding: 10px;
    background: #EBEEF5;
    height: 100%;
    overflow: hidden;
  }
</style>